package com.yike.order.service;


import com.lkl.laop.sdk.exception.SDKException;
import com.yike.common.Response.LklPayCallback;
import com.yike.common.base.BaseService;
import com.yike.common.pagination.Paging;
import com.yike.common.request.SacsSeparateNotReq;
import com.yike.order.entity.Order;
import com.yike.order.param.*;
import com.yike.order.vo.OrderListVo;
import com.yike.order.vo.RefundInfoVo;
import com.yike.order.vo.RefundVo;
import com.yike.order.vo.OrderVo;

import java.io.IOException;
import java.text.ParseException;
import java.util.Map;

/**
 * 订单表 服务类
 *
 * @author yike
 * @since 2024-07-18
 */
public interface OrderService extends BaseService<Order> {


    Map<String ,Object> lklCallback(LklPayCallback lklPayCallback);

    Map<String ,Object> sacsSeparateNot(SacsSeparateNotReq req);

    Integer  getLklStatus(String orderNo);

    /**
     * 保存
     *
     * @param order
     * @return
     * @throws Exception
     */
    String saveOrder(AddOrderParam order) throws Exception;

    /**
     * 修改
     *
     * @param order
     * @return
     * @throws Exception
     */
    boolean updateOrder(Order order) throws Exception;

    /**
     * 删除
     *
     * @param id
     * @return
     * @throws Exception
     */
    boolean deleteOrder(Long id) throws Exception;


    /**
     * 获取分页对象
     *
     * @param orderPageParam
     * @return
     * @throws Exception
     */
    Paging<OrderListVo> getUserOrderList(OrderPageParam orderPageParam) throws Exception;

    Paging<OrderListVo> getShopOrderList(ShopOrderPageParam shopOrderPageParam) throws Exception;

    Paging<RefundVo> getShopRefundList(ShopRefundPageParam shopRefundPageParam) throws Exception;

    /**
     * 订单支付
     *
     * @param payOrderParam
     * @return
     */
    Integer pay(PayOrderParam payOrderParam) throws ParseException, SDKException;


    Integer lklPay(PayOrderParam payOrderParam) throws ParseException, SDKException;

    /**
     * 退款
     *
     * @param refundOrderParam
     * @return
     * @throws ParseException
     */
    boolean refund(RefundOrderParam refundOrderParam) throws ParseException, SDKException, IOException;

    OrderVo getOrderInfo(String orderNo);

    RefundInfoVo getRefundInfo(String refundNo);

    Integer queryStatus(String orderNo) throws Exception;

    String getOrderBindingUrl(String orderNo);
}
